Use libglnx
authorColin Walters <walters@verbum.org>
Tue, 17 Feb 2015 22:38:36 +0000 (17:38 -0500)
committerColin Walters <walters@verbum.org>
Mon, 23 Feb 2015 02:02:27 +0000 (21:02 -0500)
Starting down the path of not using libgsystem.  The main win here
will be code sharing between ostree/rpm-ostree as well as going down
the path of not using GFile * for local files.

13 files changed:
.gitignore
.gitmodules [new file with mode: 0644]
Makefile-libostree.am
Makefile-ostree.am
Makefile-otutil.am
Makefile.am
autogen.sh
libglnx [new submodule]
src/libostree/ostree-core.c
src/libotutil/ot-variant-utils.c
src/libotutil/otutil.h
src/ostree/ot-admin-functions.c
src/ostree/ot-main.c

index f0a6679157a825ca2ed398c8aea6c8dd96f87d74..00f5cfcfcabfb984eb5a53e6adfd9d6a1d133d36 100644 (file)
@@ -1,6 +1,7 @@
 # Standard C/Automake goo
 .deps
 .libs
+.dirstamp
 *.typelib
 *.la
 *.lo
diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..e5084af
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "libglnx"]
+       path = libglnx
+       url = https://git.gnome.org/browse/libglnx
index a8ba8bc9f3b316c151b69612c621e2769e982a42..241b91d5af2bbcfb940e9867f15cf0b0f58fe7c0 100644 (file)
@@ -106,10 +106,10 @@ libostree_1_la_SOURCES += \
        $(NULL)
 endif
 
-libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree \
+libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree \
        $(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_DEP_LZMA_CFLAGS)
 libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -export-symbols-regex '^ostree_'
-libostree_1_la_LIBADD = libotutil.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_DEP_LZMA_LIBS)
+libostree_1_la_LIBADD = libotutil.la libglnx.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_DEP_LZMA_LIBS)
 
 if USE_LIBARCHIVE
 libostree_1_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
index 8aed75ba1dd088e3927e0db462fb56e5f6b8f603..95cf67793cd5fe5192f043d24a8f7138bc987c54 100644 (file)
@@ -75,9 +75,9 @@ ostree_SOURCES += \
 
 ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree \
        $(NULL)
-ostree_bin_shared_ldadd = libotutil.la libostree-kernel-args.la libostree-1.la
+ostree_bin_shared_ldadd = libglnx.la libotutil.la libostree-kernel-args.la libostree-1.la
 
-ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx
 ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
 
 if USE_LIBSOUP
index ffd38e09d18190f6239a9a4a89a95882068e402d..586f6d9ed68288c888542bae4f85f7e1625da225 100644 (file)
@@ -41,5 +41,5 @@ libotutil_la_SOURCES = \
        src/libotutil/otutil.c \
        src/libotutil/otutil.h \
        $(NULL)
-libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
 libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)
index e02177d107ff28012fd5a8dafd45cdcd08f2ec56..c2190c920df0de74d5dff8ec7b471300895dd405 100644 (file)
@@ -46,6 +46,12 @@ GIRS =
 TYPELIBS = $(GIRS:.gir=.typelib)
 endif
 
+libglnx_srcpath := $(srcdir)/libglnx
+libglnx_cflags := $(OT_DEP_GIO_UNIX_CFLAGS) "-I$(libglnx_srcpath)"
+libglnx_libs := $(OT_DEP_GIO_UNIX_LIBS)
+include libglnx/Makefile-libglnx.am.inc
+noinst_LTLIBRARIES += libglnx.la
+
 include Makefile-otutil.am
 include Makefile-libostree.am
 include Makefile-ostree.am
index fe690e9ff974082cdc111dc691046379516e4e56..cff4de6f05220df38f12b555cbf97b5796eb65e4 100755 (executable)
@@ -28,7 +28,13 @@ else
         gtkdocize || exit $?
 fi
 
+cd $olddir
+if ! test -f libglnx/README.md; then
+    git submodule update --init
+fi
+# Workaround automake bug with subdir-objects and computed paths
+sed -e 's,$(libglnx_srcpath),'${srcdir}/libglnx, < libglnx/Makefile-libglnx.am >libglnx/Makefile-libglnx.am.inc
+
 autoreconf --force --install --verbose
 
-cd $olddir
 test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/libglnx b/libglnx
new file mode 160000 (submodule)
index 0000000..20b507d
--- /dev/null
+++ b/libglnx
@@ -0,0 +1 @@
+Subproject commit 20b507de5c14df8da678d48f9028fe61340c390d
index 6a72251e9b8d70cb751ef9ec6c72ee5326033ebc..9a4aa0f50404f1adbeabc18cbc6ba92e9939c692 100644 (file)
@@ -31,6 +31,7 @@
 #include "ostree-chain-input-stream.h"
 #include "otutil.h"
 #include "libgsystem.h"
+#include "libglnx.h"
 
 #define ALIGN_VALUE(this, boundary) \
   (( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))
@@ -209,7 +210,7 @@ file_header_new (GFileInfo         *file_info,
   guint32 mode;
   const char *symlink_target;
   GVariant *ret;
-  gs_unref_variant GVariant *tmp_xattrs = NULL;
+  g_autoptr(GVariant) tmp_xattrs = NULL;
 
   uid = g_file_info_get_attribute_uint32 (file_info, "unix::uid");
   gid = g_file_info_get_attribute_uint32 (file_info, "unix::gid");
index c855416a6a52e04e096ad171dec9d5ee43efecb4..7aa427454ddec77d5840b716b2a4f5f0e4c8c9a4 100644 (file)
@@ -133,7 +133,7 @@ ot_util_variant_map (GFile              *src,
                      GError            **error)
 {
   gboolean ret = FALSE;
-  gs_unref_variant GVariant *ret_variant = NULL;
+  g_autoptr(GVariant) ret_variant = NULL;
   GMappedFile *mfile = NULL;
 
   mfile = gs_file_map_noatime (src, NULL, error);
index c78a9c6955f20d5f5686f8a126eb5861b03eb5cb..6d764593fd4901624795806669dad245efbb7adf 100644 (file)
@@ -26,6 +26,7 @@
 #include <libgsystem.h>
 #include <string.h> /* Yeah...let's just do that here. */
 #include <gsystem-local-alloc.h>
+#include <libglnx.h>
 
 #define ot_gobject_refz(o) (o ? g_object_ref (o) : o)
 
index 36b966163dc722da6b6d924a0c54bdff3a12ebc3..78ef8b1d7e885f01ce038da20011c7f3aef8bca9 100644 (file)
@@ -61,7 +61,7 @@ ot_admin_require_booted_deployment_or_osname (OstreeSysroot       *sysroot,
 char *
 ot_admin_checksum_version (GVariant *checksum)
 {
-  gs_unref_variant GVariant *metadata = NULL;
+  g_autoptr(GVariant) metadata = NULL;
   const char *ret = NULL;
 
   metadata = g_variant_get_child_value (checksum, 0);
index a69927d40db99dad5613b98a43443e0a76b0e19c..c48a03c50582f8a96286c230a8b632b6d039efb4 100644 (file)
@@ -27,6 +27,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <libglnx.h>
+
 #include "ostree.h"
 #include "ot-main.h"
 #include "otutil.h"
@@ -230,7 +232,7 @@ ostree_option_context_parse (GOptionContext *context,
                              GCancellable *cancellable,
                              GError **error)
 {
-  gs_unref_object OstreeRepo *repo = NULL;
+  glnx_unref_object OstreeRepo *repo = NULL;
   gboolean success = FALSE;
 
   /* Entries are listed in --help output in the order added.  We add the